-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pthread: fix key destructor calling and start function exit #304
Conversation
3b8b89c
to
50f6736
Compare
864fa71
to
ad87dee
Compare
ad87dee
to
903161c
Compare
1755420
to
96c6e84
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh, lock releasing in functions make this code difficult, but I get it that it's necessary :)
96c6e84
to
9ddde65
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Destructor calling sequence at exit did not allow for key modifications in constructors. JIRA: RTOS-652
9ddde65
to
8dea15d
Compare
After lastest change of pthreads by @lukileczo in #309 cleanup pop push were added, I had to adjust the code to the existence of them.
POSIX
LINUX interpretation:
Fixed cleanup handlers not being called in case of cancelling not self thread |
8dea15d
to
6b032ae
Compare
pthread_exit fix destroying ctx on JOINABLE thread. Rework handling of detached threads. JIRA: RTOS-654
6b032ae
to
87e41cb
Compare
Also I spotted that Line 433 in bd3db90
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-format stuff nitpick, otherwise LGTM
pthread/pthread.c
Outdated
@@ -556,7 +590,7 @@ int pthread_attr_setschedparam(pthread_attr_t *attr, | |||
return EINVAL; | |||
|
|||
if (param->sched_priority > sched_get_priority_max(SCHED_RR) || | |||
param->sched_priority < sched_get_priority_min(SCHED_RR)) | |||
param->sched_priority < sched_get_priority_min(SCHED_RR)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format is mistaken ;)
pthread/pthread.c
Outdated
if (detachstate != PTHREAD_CREATE_DETACHED || | ||
detachstate != PTHREAD_CREATE_JOINABLE) | ||
if ((detachstate != PTHREAD_CREATE_DETACHED) || | ||
(detachstate != PTHREAD_CREATE_JOINABLE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format is mistaken ;)
JIRA: RTOS-671
87e41cb
to
47c37cb
Compare
if (detachstate != PTHREAD_CREATE_DETACHED || | ||
detachstate != PTHREAD_CREATE_JOINABLE) | ||
if ((detachstate != PTHREAD_CREATE_DETACHED) || | ||
(detachstate != PTHREAD_CREATE_JOINABLE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-format-pr] reported by reviewdog 🐶
suggested fix
(detachstate != PTHREAD_CREATE_JOINABLE)) { | |
(detachstate != PTHREAD_CREATE_JOINABLE)) { |
Fixes phoenix-rtos/phoenix-rtos-project#675
Description
FIxes following posix imcompatibilities:
pthread_key_create
pthread_key_delete
pthread_exit
pthread_detach
Also reworked how detached threads are handled
Code that previousle resoulted in faults:
Motivation and Context
Types of changes
How Has This Been Tested?
Checklist:
Special treatment